<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>演示：PHP生成中间带LOGO图像的二维码</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/demo.css">
<style>
</style>
</head>
<body>
<div class="container">
    <header>
        <div class="row">
            <div class="col-md-3 col-xs-12"><h1 class="logo"><a href="http://www.helloweba.com" title="返回helloweba首页">helloweba</a></h1></div>
        </div>
    </header>
    <div class="row main">
        <div class="col-md-12">
            <h2 class="top_title"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>PHP生成中间带LOGO图像的二维码</h2>
            
            <div class="row" style="margin-top: 30px">
                <div class="col-md-offset-2 col-sm-6">
                    <form class="form-horizontal" id="add-form">
                      <div class="form-group">
                        <label for="qrcodetxt" class="col-sm-2 control-label">输入内容</label>
                        <div class="col-sm-10">
                          <textarea name="" id="qrcodetxt" cols="30" rows="5">https://www.helloweba.com</textarea>
                        </div>
                      </div>
                      
                      <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                          <button type="submit" class="btn btn-default">生成二维码</button>
                        </div>
                      </div>
                    </form>
                    <iframe id="result" src="do.php" frameborder="0" width="300" height="250"></iframe>
                </div>
                
            </div>

        </div>
    </div>
</div>
<script src="js/jquery.min.js"></script>
<script>
$('#add-form').on('submit', function(event) {
    event.preventDefault();
    var txt = encodeURI($('#qrcodetxt').val());
    $('#result').attr('src', 'do.php?cont='+txt);
});
</script> 
</body>
</html>